package com.stock.core.persistence.reader.stock;

import com.stock.api.domain.stock.BusinessHistoryBean;
import com.stock.api.domain.stock.StockHistoryBean;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface BusinessHistoryReaderMapper {


    /**
     * 根据指定主键获取一条数据库记录,business_history
     *
     * @param id
     */
    BusinessHistoryBean selectByPrimaryKey(Long id);

    /**
     * 根据股票代码获取未买入或未卖出的业务数据
     *
     * @param stockHistoryBean
     * @return
     */
    List<BusinessHistoryBean> selectBusinessHistory(StockHistoryBean stockHistoryBean);

    /**
     * 根据股票代码获取买入未卖出
     *
     * @param stockCode
     * @return
     */
    List<BusinessHistoryBean> selectBusinessHistoryByStockCode(String stockCode);

    /**
     * 根据股票代码获取总收益
     *
     * @param stockCode
     * @return
     */
    BigDecimal getSumProfit(String stockCode);

    /**
     * 根据股票代码获取买入总金额
     *
     * @param stockCode
     * @return
     */
    BigDecimal getTotalMarketValue(String stockCode);
}